/*
 * =====================================================================================
 *
 *       Filename:  nokia.h
 *
 *    Description:  
 *
 *        Version:  1.0
 *        Created:  02/14/2011 04:51:40 PM
 *       Revision:  none
 *       Compiler:  gcc
 *
 *         Author:  dp (8023), dp8023@gmail.com
 *        Company:  
 *
 * =====================================================================================
 */

#pragma once

#include <iostream>
#include <string>

using namespace std;

class nokia
{
	public:
		nokia(){}
		virtual ~nokia(){}

		virtual bool makecall(const string &number) const = 0;
};

class N96:public nokia
{
	public:
		N96()
		{
			cout << "N96." << endl;
		}
		~N96(){}

		bool makecall(const string &number) const
		{
			cout << "Use N96 makecall number is: " << number.c_str() << endl;
			return true;
		}
};

class N95:public nokia
{
	public:
		N95()
		{
			cout << "N95." << endl;
		}
		~N95()
		{}
		bool makecall(const string &number) const
		{
			cout << "Use N95 makecall number is: " << number.c_str() << endl;
			return true;
		}
};

class factorymethod
{
	public:
		factorymethod(){}
		virtual ~factorymethod(){}
		virtual nokia *createnokia() = 0;
};

class N96factory:public factorymethod
{
	public:
		nokia *createnokia()
		{
			return new N96();
		}
};

class N95factory:public factorymethod
{
	public:
		nokia *createnokia()
		{
			return new N95();
		}
};

